import React, {Component} from 'react';

import {Popconfirm, Button} from 'antd';

import noop from 'util/noop';

export default class FixedSubmit extends Component {
    static defaultProps = {
        cancel: noop,
        save: noop,
        loading: false
    }


    render() {
        const {loading, save, cancel} = this.props;

        return (
            <div className="fixedSubmit">
                <div className="t-center">
                    <Popconfirm placement="topRight" title={"您确定要放弃保存吗？"} onConfirm={cancel} okText="确定" cancelText="取消">
                        <Button type="default" className="pushr">取消</Button>
                    </Popconfirm>
                    <Button type="primary" loading={loading} onClick={save}>保存</Button>
                </div>
            </div>
        )
    }
}